function myInstanceOf(fn1, fn2) {
    let a = fn1.__proto__
    let b = fn2.prototype
    while(true) {
        if(a == null) {
            return false
        }
        if(a == b) {
            return true
        }
       
        a = a.__proto__
    }
}

class A {
    constructor(name) {
        this.name = name
    }
}

let a = new A('csc')
console.log(A.__proto__.__proto__.__proto__, a.prototype);
console.log(myInstanceOf(A, a));